<html>
<head>
    <title>第一个本地页面</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="./style.css" />
</head>

<body>
    这是第一个本地页面<br />
    它的地址是：
    <script src="./a.js"></script>
    <a href="test.html" target="_blank">打开一个新窗口</a>
    <br />
    <div id="test"></div>
    <img src="../img/web.png"/>
    <button onclick="ipc_send()">IPC string 测试</button>

    <button onclick="ipc_send_int()">IPC int 测试</button>

    <script>
        function ipc_send() {
            ipcRenderer.send('example_event', "test", (response) => {
                console.log("rsponse string: ")
                console.log(response);
            });

        }

        function ipc_send_int() {
            ipcRenderer.send('example_event_int', 999, (response) => {
                console.log("rsponse int: ")
                console.log(response);
            });
        }

        function ipc_call_js() {
            ipcRenderer.on('call_js', (arg) => {
                console.log(arg);
                console.log("cangjie call ......")
                document.getElementById("test").innerHTML = "<p>仓颉调用js</p>"
                return 78889
            });
        }
        ipc_call_js()

    </script>
    </script>

</body>

</html>